﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RaSuperGrid.SuperGrid;

namespace RaSuperGrid.SuperGrid.Model
{
    class PR
    {
        public DateTime ReqDate { get; set; }
        public DateTime NeedDate { get; set; }
        public UrgencyType Urgency { get; set; }
        public int Reason { get; set; }
        public string ReqPerson { get; set; }
        public string Contact { get; set; }
        public double Cost { get; set; }
        public bool Repeatable { get; set; }
        public string Description { get; set; }
        public string Special { get; set; }

        public PR MakeCopy()
        {
            return new PR
            {
                ReqDate = ReqDate,
                NeedDate = NeedDate,
                Urgency = Urgency,
                Reason = Reason,
                ReqPerson = ReqPerson,
                Contact = Contact,
                Cost = Cost,
                Repeatable = Repeatable,
                Description = Description,
                Special = Special
            };
        }

        public static PR NewPR()
        {
            return new PR
            {
                ReqDate = DateTime.Today,
                NeedDate = DateTime.Today.AddDays(7),
                Urgency = UrgencyType.Low,
                Reason = (int) RequestReasonType.Department,
                ReqPerson = "",
                Contact = "",
                Cost = 0,
                Repeatable = true,
                Description = "",
                Special = ""
            };
        }

        public static IEnumerable<PR> GetPRs()
        {
            return new PR[]
            {
                new PR
                {
                    ReqDate = DateTime.Today,
                    NeedDate = DateTime.Today.AddDays(5),
                    Urgency = UrgencyType.High,
                    Reason = (int) RequestReasonType.Department,
                    ReqPerson = "James Zheng",
                    Contact = "+065-91231236",
                    Cost = 1000,
                    Repeatable = true,
                    Description = "Mass purchase",
                    Special = "Get the highest range possible"
                },

                new PR
                {
                    ReqDate = DateTime.Today,
                    NeedDate = DateTime.Today.AddDays(4),
                    Urgency = UrgencyType.Low,
                    Reason = (int) RequestReasonType.Project,
                    ReqPerson = "Ching Yuh",
                    Contact = "+065-95631239",
                    Cost = 2000,
                    Repeatable = false,
                    Description = "Project purchase",
                    Special = "Need a touch screen"
                },

                new PR
                {
                    ReqDate = DateTime.Today,
                    NeedDate = DateTime.Today.AddDays(2),
                    Urgency = UrgencyType.Now,
                    Reason = (int) RequestReasonType.Upgrade,
                    ReqPerson = "Krunal",
                    Contact = "+065-95231734",
                    Cost = 1500,
                    Repeatable = true,
                    Description = "Existing PC runs too slow",
                    Special = "Need a wireless keyboard"
                },
            };
        }
    }
}
